package com.wash.shoes.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wash.shoes.entity.FactoryshelvesRackGridPo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface FactoryshelvesRackGridService extends IService<FactoryshelvesRackGridPo> {
    /**
     * 分配货架号
     *
     * @param shoeNum   需要的货架数量
     * @param factoryId 工厂id
     * @return
     */
    List<FactoryshelvesRackGridPo> shareGridList(Integer shoeNum, String factoryId, String orderId);

    /**
     * 查询列表
     *
     * @param factoryshelvesId 货架格子id
     * @param orderNo          订单号
     * @param phone            关键字 手机号
     * @return
     */
    Page<FactoryshelvesRackGridPo> queryListByParam(IPage page, @Param("factoryshelves_id") String factoryshelvesId,
                                                    @Param("orderNo") String orderNo, @Param("phone") String phone, int lastNum);

    /**
     * 根据格子id释放绑定的订单号
     *
     * @param id 格子id
     * @return
     */
    int updateFactoryShevelsOrderIdWithId(@Param("id") String id);
}
